package com.wsoft.constant.redis;

/**
 * redis常量
 *
 * @author: juiet
 * @date: 2024年09月03日 10:55
 */
public class RedisKeyConstant {
    /**
     * 固定key类型
     */
    public static final String REDIS_NULL = "REDIS_NULL";
    public static final String REDIS_SELF = "REDIS_SELF";
    public static final String REDIS_PATTERN = "REDIS_PATTERN";

    /**
     * redis 通配符
     */
    public static final String PATTERN_SYMBOL="*";
    /**
     * 验证码缓存key + 验证码标识
     */
    public static final String VERIFICATION_CODE = "VERIFICATION_CODE:";
    /**
     * 用户登录次数缓存key + 用户名
     */
    public static final String LOGIN_USER_COUNT = "LOGIN_USER_COUNT:";
    /**
     * 用户登录缓存key + 用户名
     */
    public static final String USER_INFO_CACHE = "USER_INFO_CACHE:";
    public static final String CACHE_TYPE_ALL_DEPT = "CACHE_TYPE_ALL_DEPT";

    public static final String ORG_CACHE = "ORG_CACHE:";

    public static final String ORG_TREE_CACHE = "ORG_TREE_CACHE";


    /**
     * 字典缓存key +字典编码
     */
    public static final String DICT_CACHE = "DICT_CACHE:";

    public static final String DICT_CACHE_ALL = "DICT_CACHE_ALL";

    public static final String DICT_CACHE_ALL_NO_TREE = "DICT_CACHE_ALL_NO_TREE";

    public static final String CONFIG_CACHE_ALL = "CONFIG_CACHE_ALL";

    public static final String CONFIG_CACHE = "CONFIG_CACHE:";

    public static final String CONFIG_CACHE_CODE = "CONFIG_CACHE_CODE:";

    public static final String CONFIG_INFO = "CONFIG_INFO:";

    public static final String CONFIG_INFO_CODE = "CONFIG_INFO_CODE:";

    public static final String CONFIG_INFO_ORG = "CONFIG_INFO_ORG:";

    public static final String CONFIG_INFO_MEMBER = "CONFIG_INFO_MEMBER:";

    public static final String MODEL_DATA_CACHE_KEY_TEMPLATE = "ModelDataCache:{}:{}";

    public static final String MODEL_DATA_CACHE_KEY_FIND_BY_MODEL_ID = "ModelDataCache:{}*";

    public static final String DATA_PERM = "DATA_PERM:";

    public static final String DEFAULT_DATA_PERM = "DEFAULT_DATA_PERM";

    public static final String POST_CACHE = "POST_CACHE:";

    public static final String POST_ALL_CACHE = "POST_All_CACHE";

    public static final String LEVEL_CACHE = "LEVEL_CACHE:";

    public static final String LEVEL_ALL_CACHE = "LEVEL_ALL_CACHE";



    public static final String MENU_TREE_ALL = "MENU_TREE_ALL";

    public static final String MENU_CACHE = "MENU_CACHE:";

    public static final String ROLE_DATA_PERM_CACHE = "ROLE_DATA_PERM_CACHE:";

    public static final String ROLE_MENU_CACHE = "ROLE_MENU_CACHE:";

    public static final String ROLE_CACHE = "ROLE_CACHE:";

    public static final String MEMBER_CACHE = "MEMBER_CACHE:";

    public static final String MEMBER_ALL_CACHE = "MEMBER_ALL_CACHE";


    public static final String MEMBER_ROLE_CACHE = "MEMBER_ROLE_CACHE:";

    public static final String MEMBER_POST_CACHE = "MEMBER_POST_CACHE:";

    public static final String ACCOUNT_ALL_CACHE = "ACCOUNT_ALL_CACHE";

    /**
     * 自定义表单 redis key
     */
    public static class Form {

        /**
         * 自定义表单默认过期时间
         */
        public static final String EXPIRED = "604800";

        /**
         * 自定义表单前缀
         */
        private static final String FORM = "FORM:";

        //############################# form  ##############################
        public static final String FORM_PREFIX = FORM + "FORM:";

        /**
         * key:formCode
         * value:form
         */
        public static final String FORM_CODE = FORM_PREFIX + "CODE:";
        /**
         * key:formId
         * value:formEntity
         */
        public static final String FORM_INFO = FORM_PREFIX + "INFO:";


        //############################# table  ##############################
        /**
         * table前缀
         */
        public static final String TABLE_PREFIX = FORM + "TABLE:";
        /**
         * key:formId
         * value:tableList
         */
        public static final String TABLE_LIST = TABLE_PREFIX + "LIST:";
        /**
         * key:tableId
         * value:tableEntity
         */
        public static final String TABLE_INFO = TABLE_PREFIX + "INFO:";

        //############################# column  ##############################
        /**
         * column 前缀
         */
        public static final String COLUMN_PREFIX = FORM + "COLUMN:";
        /**
         * key:tableId
         * value:columnList
         */
        public static final String COLUMN_LIST = COLUMN_PREFIX + "LIST:";
        /**
         * key:columnId
         * value:columnEntity
         */
        public static final String COLUMN_INFO = COLUMN_PREFIX + "INFO:";

        //############################# design  ##############################
        /**
         * design 前缀
         */
        public static final String DESIGN_PREFIX = FORM + "DESIGN:";
        /**
         * key:formId
         * value:designList
         */
        public static final String DESIGN_LIST = DESIGN_PREFIX + "LIST:";
        /**
         * key:designId
         * value:designEntity
         */
        public static final String DESIGN_INFO = DESIGN_PREFIX + "INFO:";


        //############################# virtualColumn  ##############################
        /**
         * virtualColumn 前缀
         */
        public static final String VIRTUAL_COLUMN_PREFIX = FORM + "VIRTUAL:";
        /**
         * key:table
         * value:virtualColumnList
         */
        public static final String VIRTUAL_COLUMN_LIST = VIRTUAL_COLUMN_PREFIX + "LIST:";
        /**
         * key:id
         * value:virtualColumnEntity
         */
        public static final String VIRTUAL_COLUMN_INFO = VIRTUAL_COLUMN_PREFIX + "INFO:";

        //############################# tableRelation  ##############################
        /**
         * tableRElation 前缀
         */
        public static final String TABLE_RELATION_PREFIX = FORM + "RELATION:";
        /**
         * key:formId
         * value:tableRelationList
         */
        public static final String TABLE_RELATION_LIST = TABLE_RELATION_PREFIX + "LIST:";
        /**
         * key:id
         * value:tableRelationEntity
         */
        public static final String TABLE_RELATION_INFO = TABLE_RELATION_PREFIX + "INFO:";


        //############################# link  ##############################
        /**
         * link 前缀
         */
        public static final String LINK_PREFIX = FORM + "LINK:";
        /**
         * key:id
         * value:linkEntity
         */
        public static final String LINK_INFO = LINK_PREFIX + "INFO:";


    }

    /**
     * 附件服务器 redis key
     */
    public static class Oss {
        /**
         * 文件上传默认过期时间 单位秒 86400 = 1day
         */
        public static final long EXPIRED = 86400;

        /**
         * 文件上传
         */
        private static final String OSS = "OSS:";
        /**
         * 已上传part index
         */
        public static final String OSS_PART_INDEX = OSS + "PART:MD5:";
        /**
         * 已上传part fileName
         */
        public static final String OSS_FILE_NAME = OSS + "FILENAME:MD5:";
        /**
         * 已上传文件大小
         */
        public static final String OSS_FILE_SIZE = OSS + "FILESIZE:MD5:";
    }

    /**
     * 自定义规则 redis key
     */
    public static class Rule{
        /**
         * 自定义规则默认过期时间 单位秒 86400 = 1day
         */
        public static final long EXPIRED = 86400;

        /**
         * 自定义规则
         */
        private static final String RULE = "RULE:";

        /**
         * 规则code
         * key: code
         * value : ruleEntity
         */
        public static final String RULE_CODE = RULE + "CODE:";
        /**
         * 规则id
         * key: id
         * value : ruleEntity
         */
        public static final String RULE_ID = RULE + "ID:";
    }

    /**
     * 任务调度 redis key
     */
    public static class Job{
        /**
         * 任务调度默认过期时间 单位秒 86400 = 1day
         */
        public static final String EXPIRED = "86400";

        /**
         * 自定义规则
         */
        private static final String JOB = "JOB:";

        /**
         * 任务调度code
         * key: code
         * value : jobEntity
         */
        public static final String JOB_CODE = JOB + "CODE:";
        /**
         * 任务调度id
         * key: id
         * value : jobEntity
         */
        public static final String JOB_ID = JOB + "ID:";
    }

    /**
     * 新闻公告
     */
    public static class Cms{
        /**
         * CMS默认过期时间 单位秒 86400 = 1day
         */
        public static final String EXPIRED = "86400";

        /**
         * 新闻公告
         */
        private static final String CMS = "CMS:";

        //############################# category  ##############################


        /**
         * key:categoryId,value:categoryEntity
         */
        public static final String CMS_CATEGORY_INFO = CMS + "CATEGORY:INFO:";
        /**
         * value : cateList
         */
        public static final String CMS_CATEGORY_TREE = CMS + "CATEGORY:TREE";

        //############################# category-auth  ##############################

        /**
         * key:categoryId,value:orgIdList
         */
        public static final String CMS_CATEGORY_AUTH_INFO = CMS + "CATE-AUTH:INFO:";


        //############################# anno  ##############################
        /**
         * key:annoId,value annoEntity
         */
        public static final String CMS_ANNO_INFO = CMS + "ANNO:INFO:";


        //############################# anno-file  ##############################
        /**
         * key:annoId,value :annoFileList
         */
        public static final String CMS_ANNO_FILE_INFO= CMS + "ANNO-FILE:INFO:";


        //############################# anno-read  ##############################
        /**
         * key:annoId,value:set
         */
        public static final String CMS_ANNO_READ_LIST= CMS + "ANNO-READ:LIST:";
        /**
         * key:annoId,memberId,value:annoReadEntity
         */
        public static final String CMS_ANNO_READ_INFO= CMS + "ANNO-READ:INFO:";

        /**
         * key:memberId,value:set
         */
        public static final String CMS_ANNO_READ_MEMBER_LIST= CMS + "ANNO-READ:MEMBER:LIST:";


        //############################# anno-comment  ##############################
        /**
         * key:commentId,value:commentEntity
         */
        public static final String CMS_ANNO_COMMENT_INFO= CMS + "ANNO-COMMENT:INFO:";


        //############################# anno-summary  ##############################
        /**
         * key: annoId,value:summaryEntity
         */
        public static final String CMS_ANNO_SUMMARY_INFO= CMS + "ANNO-SUMMARY:INFO:";

    }


    /**
     * 模块
     */
    public static class Module{
        /**
         * 模块
         */
        private static final String MODULE = "MODULE:";

        /**
         * 默认过期时间 单位秒 86400 = 1day
         */
        public static final String EXPIRED = "86400";

        /**
         * key:code,value:moduleEntity
         */
        public static final String MODULE_CODE= MODULE + "CODE:";
        /**
         * key:id,value:moduleEntity
         */
        public static final String MODULE_ID= MODULE + "ID:";
    }

    /**
     * 待办
     */
    public static class Config{
        /**
         * 待办
         */
        private static final String CONFIG = "DC:CONFIG:";

        /**
         * 默认过期时间 单位秒 86400 = 1day
         */
        public static final String EXPIRED = "86400";

        /**
         * key:code,value:configEntity
         */
        public static final String CONFIG_CODE = CONFIG + "CODE:";
        /**
         * key:id,value:configEntity
         */
        public static final String CONFIG_ID = CONFIG + "ID:";
        /**
         * 待办已读
         */
        public static final String MEMBER_READ = CONFIG + "READ:";

    }


    /**
     * 待办
     */
    public static class ConfigEntity{
        /**
         * 待办
         */
        private static final String CONFIG_ENTITY = "DC:CONFIG-ENTITY:";

        /**
         * 默认过期时间 单位秒 86400 = 1day
         */
        public static final String EXPIRED = "86400";

        /**
         * key:id,value:configEntityEntity
         */
        public static final String CONFIG_ENTITY_ID = CONFIG_ENTITY + "ID:";
        /**
         * key:configId,value:configEntityEntityList
         */
        public static final String CONFIG_CONFIG_ID = CONFIG_ENTITY + "CONFIG_ID:";

    }


    /**
     * 门户
     */
    public static class Portal{

        public static final String PORTAL = "PORTAL:";

        /**
         * 默认过期时间 单位秒 86400 = 1day
         */
        public static final String EXPIRED = "86400";
        /**
         * 主题
         */
        private static final String THEME = PORTAL + "THEME:";

        /**
         * key:code,value:themeEntity
         */
        public static final String THEME_CODE = THEME + "CODE:";

        /**
         * key:id,value:themeEntity
         */
        public static final String THEME_ID = THEME + "ID:";
        //############################# theme_org_member  ##############################

        /**
         * org_member
         */
        public static final String ORG_MEMBER = PORTAL + "ORG_MEMBER:";

        /**
         * key:themeID,value:orgMemberID
         */
        public static final String ORG_MEMBER_THEME_ID = ORG_MEMBER + "THEME_ID:";
        /**
         * key:id,value:orgMemberEntity
         */
        public static final String ORG_MEMBER_INFO = ORG_MEMBER + "ID:";

        //############################# module  ##############################

        /**
         * 模块
         */
        public static final String MODULE = PORTAL + "MODULE:";


        /**
         * key:id,value:moduleEntity
         */
        public static final String MODULE_ID = MODULE + "ID:";

        /**
         * key:portalId,value:moduleEntity
         */
        public static final String MODULE_LIST = MODULE + "LIST:";


        //############################# module-sub  ##############################
        /**
         * 模块
         */
        public static final String MODULE_SUB = PORTAL + "MODULE_SUB:";


        /**
         * key:id,value:moduleSubEntity
         */
        public static final String MODULE_SUB_ID = MODULE_SUB + "ID:";
        /**
         * key:parId,value:List<moduleSubEntity>
         */
        public static final String MODULE_SUB_LIST = MODULE_SUB + "LIST:";

    }
}
